const { merge } = require('webpack-merge');
const webpack = require('webpack')
const common = require('./webpack.common.js');
const path = require('path')

module.exports = merge(common, {
    mode:'development',
    devtool:'cheap-module-eval-source-map',
    module: {
        rules: [
            {
                test: /\.css$/,
                use: [
                    'style-loader',
                    'css-loader'
                ]
            },
            {
                test: /\.less$/,
                use: [
                    'style-loader',
                    'css-loader',
                    'less-loader'
                ]
            }
        ]
    },
    devServer: {
        contentBase: path.join(__dirname,'public'),
        port: "8080",
        inline: true,
        historyApiFallback: true, 
        hot: true  
    },
    plugins: [
        new webpack.HotModuleReplacementPlugin()
      ]
})